﻿using System;
using System.Net;
using caedisi.Models;
using System.Linq;
using caedisi.Helpers;

namespace caedisi.Web.DataModel
{
    public partial class CellStateType
    {
        partial void OnCellStateTypeIdChanged()
        {
            if (Globals.Instance.Lovs.CellStateTypes == null)
                return;

            CellStateType newCellStateType = EntityHelper.GetCellStateType(this.CellStateTypeId);

            if (newCellStateType!=null)
            {
                this.Color = newCellStateType.Color;
                this.RaisePropertyChanged("Color");
            }
        }
    }
}
